"use strict";
//  泛型定义
//  传入什么类型的参数返回什么类型的参数
//  类，接口，方法的复用
// 泛型函数
function getDatass(value) {
    return value;
}
console.log(getDatass(12));
//  泛型类
var MinClass = /** @class */ (function () {
    function MinClass() {
        this.minNum = [];
    }
    MinClass.prototype.add = function (value) {
        this.minNum.push(value);
    };
    MinClass.prototype.min = function () {
        var minValue = this.minNum[0];
        for (var i = 0; i < this.minNum.length; i++) {
            if (this.minNum[i] < minValue) {
                minValue = this.minNum[i];
            }
        }
        return minValue;
    };
    return MinClass;
}());
var m1 = new MinClass(); //实例化 并指定T代表的类型
m1.add(1);
m1.add(3);
m1.add(-1);
var minValue = m1.min();
console.log(minValue);
//  泛型方法
var md5 = function (key1, value1) {
    return key1;
};
console.log(md5('ywj', '最帅'));
var md = function (value) {
    return value;
};
console.log(md('123'));
//  类作为类型 类似与java的Javabean
var MysqlDb = /** @class */ (function () {
    function MysqlDb() {
    }
    MysqlDb.prototype.add = function (info) {
        console.log(info);
        return true;
    };
    return MysqlDb;
}());
var Student = /** @class */ (function () {
    function Student(name, password, id) {
        this.name = name;
        this.password = password;
        this.id = id;
    }
    return Student;
}());
var student = new Student('ywj', 'ywj19980121', '16131018');
var mysqlDb = new MysqlDb();
mysqlDb.add(student);
